
GET
  FILE='C:\Data\USoc\UKDA-6614-spss\spss\spss14\a_indresp.sav'   /keep =pidp a_hidp a_pno a_sex a_dvage a_mvever a_mvyr a_mlstat a_ukborn a_plbornc a_yr2uk4 a_citzn1 
 a_citzn2 a_citzn3 a_qfhigh a_pacob a_payruk a_payruk1 a_macob a_mayruk a_mayruk1 a_pgprob a_pgmrob 
 a_natid1 a_natid2 a_natid3 a_natid4 a_natid5 a_natid6 a_natid97 a_racel a_paid a_spaid a_maid a_smaid 
 a_britid a_englang a_engspk a_spkdif a_engtel a_teldif a_engread a_readdif a_engform a_formdif a_oprlg 
 a_oprlg0 a_oprlg0ni a_oprlg1 a_nirel a_niact a_oprlg2 a_oprlg3 a_mabroad a_mnotherc a_moveage a_mlivedist 
 a_lcmarm a_lcmary4 a_mpno a_lcmcoh a_lcmcbm a_lcmcby4 a_lcmspm a_lcmspy4 a_nmar a_lcoh a_lncoh a_sf1 
 a_jbseg_dv a_jbrgsc_dv a_jbsect a_jbsectpub a_jbhrs a_jbttwt a_basrest a_lvrel1 a_lvrel2 a_lvrel3 
 a_lvrel4 a_lvrel5 a_lvrel6 a_lvrel7 a_lvrel8 a_lvrel96 a_maage a_paage a_parmar a_ohch16 a_seekid a_wekid 
 a_finnow a_finfut a_vote1 a_vote2 a_vote3 a_vote4 a_vote5 a_vote6 a_envhabit1 a_envhabit2 a_envhabit3 
 a_envhabit4 a_envhabit5 a_envhabit6 a_envhabit7 a_envhabit8 a_envhabit9 a_envhabit10 a_envhabit11 a_drive 
 a_mobuse a_netuse a_nch14resp a_nnatch a_nadoptch a_vote3_all a_vote4_all a_prfitb a_prfitbw a_prfitba 
 a_country a_marstat a_livesp a_livewith a_employ a_respf16 a_respm16 a_ioutcome a_ivfio a_hhresp_dv
 a_agegr10_dv a_mastat_dv a_swemwbs_dv a_hiqual_dv a_jbft_dv a_jbnssec5_dv a_fimnlabgrs_dv
 a_fimngrs_dv a_gor_dv a_urban_dv a_indinus_xw .

* Only look at full interviews, in fully cooperating households .
SELECT IF a_ioutcome = 11.
SELECT IF a_hhresp_dv = 1.

RENAME VARIABLES (a_indinus_xw = a_weight_xs) .
COMPUTE a_wave = 1 .

sort cases by pidp.

SAVE OUTFILE='C:\Data\USoc\UKDA-6614-spss\spss\spss14\USoc_w_a.sav'
  /COMPRESSED .


* Wave 2 .

GET FILE = "C:\Data\USoc\UKDA-6614-spss\spss\spss14\b_indresp.sav" /KEEP =  pidp b_hidp b_pno b_sex b_dvage b_mvever b_mvyr b_mlstat b_ukborn b_plbornc b_yr2uk4 b_citzn1
 b_citzn2 b_citzn3 b_qfhigh b_pacob b_macob
 b_natid1 b_natid2 b_natid3 b_natid4 b_natid5 b_natid6 b_natid97 b_racel b_oprlg
 b_oprlg0 b_oprlg0ni b_oprlg1 b_nirel b_niact
 b_jbseg_dv b_jbrgsc_dv b_jbsect b_jbsectpub b_jbhrs b_jbttwt b_basrest
 b_finnow b_finfut b_vote1 b_vote2 b_vote3 b_vote4 b_vote5 b_vote6 b_vote7 b_vote8
 b_volun b_volfreq b_volhrs b_chargv b_charfreq b_charam
 b_hubuys b_hufrys b_humops b_huiron b_hupots b_hudiy  b_husits b_huboss b_howlng b_drive
 b_mobuse b_netuse b_nch14resp b_nnatch b_nadoptch b_vote3_all b_vote4_all b_prfitb b_prfitbw b_prfitba
 b_country b_marstat b_livesp b_livewith b_employ b_respf16 b_respm16 b_ioutcome b_ivfio b_hhresp_dv
 b_agegr10_dv b_mastat_dv b_hiqual_dv b_jbft_dv b_jbnssec5_dv b_fimnlabgrs_dv
 b_fimngrs_dv b_gor_dv b_urban_dv b_indinus_xw .

* Only look at full interviews, in fully cooperating households .

SELECT IF b_ioutcome = 11 .
SELECT IF b_hhresp_dv = 1 .
RENAME VARIABLE (rename b_indinus_xw = b_weight_xs) .
COMPUTE b_wave=2 .
sort cases by pidp .

SAVE OUTFILE='C:\Data\USoc\UKDA-6614-spss\spss\spss14\usoc_w_b.sav' .


* wave 3 .
GET FILE = "C:\Data\USoc\UKDA-6614-spss\spss\spss14\c_indresp.sav" /KEEP = keep pidp c_hidp c_pno c_sex c_dvage c_mvever c_mvyr c_mlstat c_ukborn c_plbornc c_yr2uk4 c_citzn1
 c_citzn2 c_citzn3 c_qfhigh c_pacob c_macob
 c_natid1 c_natid2 c_natid3 c_natid4 c_natid5 c_natid6 c_natid97 c_racel c_oprlg
 c_oprlg0 c_oprlg0ni c_oprlg1 c_nirel c_niact
 c_jbseg_dv c_jbrgsc_dv c_jbsect c_jbsectpub c_jbhrs c_jbttwt c_basrest
 c_finnow c_finfut c_vote1 c_vote2 c_vote3 c_vote4 c_vote5 c_vote6
 c_poleff1 c_poleff2 c_poleff3 c_poleff4
 c_newsmain c_paperm2 c_tvm2 c_netm2 c_tvhours c_drive
 c_mobuse c_netuse c_nch14resp c_nnatch c_nadoptch c_vote3_all c_vote4_all c_prfitb c_prfitbw c_prfitba
 c_country c_marstat c_livesp c_livewith c_employ c_respf16 c_respm16 c_ioutcome c_ivfio c_hhresp_dv
 c_agegr10_dv c_mastat_dv c_hiqual_dv c_jbft_dv c_jbnssec5_dv c_fimnlabgrs_dv
 c_fimngrs_dv c_gor_dv c_urban_dv c_indinub_xw .

SELECT IF c_ioutcome = 11 .
SELECT IF c_hhresp_dv = 1 .

rename variables (c_indinub_xw = c_weight_xs) .
compute gen c_wave=3 .
sort cases by pidp .

SAVE OUTFILE='C:\Data\USoc\UKDA-6614-spss\spss\spss14\usoc_w_c.sav' .

NEW FILE .
MATCH FILES
 /FILE = 'C:\Data\USoc\UKDA-6614-spss\spss\spss14\usoc_w_a.sav' /IN=wavea
 /FILE = 'C:\Data\USoc\UKDA-6614-spss\spss\spss14\usoc_w_b.sav' /IN=waveb
 /FILE = 'C:\Data\USoc\UKDA-6614-spss\spss\spss14\usoc_w_c.sav' /IN=waveb
 /BY pidp .

SAVE OUTFILE='C:\Data\USoc\UKDA-6614-spss\spss\spss14\usoc_w_abc.sav' .


* Create convenient Excel short file
* GET FILE ='C:\Data\USoc\UKDA-6614-spss\spss\spss14\USoc_w_a.sav' .
* SAMPLE 200 from 35705 .
* SAVE TRANSLATE OUTFILE='C:\Data\Understanding Society\UKDA-6614-spss\spss\spss14\USocTeach2.xlsx'
  /TYPE=XLS
  /VERSION=12
  /MAP
  /REPLACE
  /FIELDNAMES
  /CELLS=LABELS
  /DROP=a_isyear a_mvever a_mvyr a_mlstat a_ukborn a_plbornc a_yr2uk4 a_citzn1 a_citzn2 a_citzn3 a_qfhigh a_pacob a_payruk a_payruk1
 a_macob a_mayruk a_mayruk1 a_pgprob a_pgmrob a_natid1 a_natid2 a_natid3 a_natid4 a_natid5 a_natid6 a_natid97 a_paid a_spaid a_maid a_smaid
 a_britid a_engspk a_spkdif a_engtel a_teldif a_engread a_readdif a_engform a_formdif a_oprlg a_oprlg0 a_oprlg0ni a_oprlg1 a_nirel a_niact a_oprlg3 a_mabroad
  a_mnotherc a_moveage a_mlivedist a_lcmarm a_lcmary4 a_mpno a_lcmcoh a_lcmcbm a_lcmcby4 a_lcmspm a_lcmspy4 a_nmar a_lcoh a_lncoh a_sf1 a_jbseg_dv
 a_jbrgsc_dv a_jbsect a_jbsectpub a_jbhrs a_lvrel1 a_lvrel2 a_lvrel3 a_lvrel4 a_lvrel5 a_lvrel6 a_lvrel7 a_lvrel8 a_lvrel96 a_maage a_paage a_parmar a_ohch16 a_seekid a_wekid
 a_finnow a_finfut a_vote4 a_vote5 a_envhabit1 a_envhabit2 a_envhabit3 a_envhabit4 a_envhabit5 a_envhabit6 a_envhabit7 a_envhabit8 a_envhabit9 a_envhabit10 a_envhabit11
 a_drive a_nch14resp a_nnatch a_nadoptch a_vote3_all a_vote4_all a_prfitb a_prfitbw a_country a_livesp a_livewith a_respf16 a_respm16 a_ioutcome a_ivfio_dv a_hhresp_dv a_agegr10_dv
 a_mastat_dv a_swemwbs_dv a_hiqual_dv a_jbft_dv a_jbnssec5_dv a_fimnlabnet_dv a_fimnlabgrs_dv a_fimngrs_dv a_fimnnet_dv a_urindew_dv a_urindsc_dv a_urindni_dv a_indinus_xw.
